<template>
    <div>
        <div class="i-layout-page-header">
            <PageHeader title="基本信息" hidden-breadcrumb/>
        </div>
        <Card :bordered="false" dis-hover class="ivu-mt i-table-no-border">
            <DescriptionList title="基本信息" :col="1">
                <Description term="角色名称：">{{data.roleName}}</Description>
                <Description term="权限字符：">{{data.roleKey}}</Description>
                <Description term="权限范围：">
                    <span v-if="data.dataScope = '1'"> 全部数据权限</span>
                    <span v-if="data.dataScope = '2'"> 本部门数据权限</span>
                    <span v-if="data.dataScope === '3'"> 本部门及以下数据权限</span>
                    <span v-if="data.dataScope === '4'"> 仅本人数据权限</span>
                </Description>
                <Description term="状态：">
                    <span v-if="data.status = '0'"> 禁用</span>
                    <span v-if="data.status = '1'"> 启用</span>
                </Description>
                <Description term="创建时间：">{{data.createTime}}</Description>
            </DescriptionList>
            <Divider/>
        </Card>
    </div>
</template>
<script>
    import Employee from "@/api/Employee"

    export default {
        data() {
            return {
                data: ''
            }
        },
        created() {
            this.getDtail();
        },
        methods: {
            getDtail() {
                Employee.selectById({
                    roleId: this.$route.query.roleId
                })
                    .then(res => {
                        // 返回数据
                        this.data = res;
                    })
                    .catch(err => {
                        // 异常情况
                    })
            }
        }

    }
</script>
